﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.ProductDetailsModels>" %>
<%if(Model!=null && Model.Product!=null){ %>
<div class="tag-parent">
    <img class="tag" src="/images/icon_tag.gif" />
    <div class="tag-pos">
    <% var path1 = string.Format("/product/index/{0}/0/0/0/0/0/0/0",
                       Model.Product.TypeID);
       var path2 = string.Format("/product/index/{0}/{1}/0/0/0/0/0/0",
                      Model.Product.TypeID,
                      Model.Product.CatID);
       var path3 = string.Format("/product/index/{0}/{1}/{2}/0/0/0/0/0",
                      Model.Product.TypeID,
                      Model.Product.CatID,
                      Model.Product.CityID);
       var path4 = string.Format("/product/index/{0}/{1}/{2}/{3}/0/0/0/0",
                      Model.Product.TypeID,
                      Model.Product.CatID,
                      Model.Product.CityID,
                      Model.Product.DistrictID);
      
        %>
    <h3 class="tag-text">
       <a href="<%=path1 %>"><%=Html.Encode(Model.Product.ProductType.Name) %></a>, &nbsp;
       <a href="<%=path2 %>"><%=Html.Encode(Model.Product.ProductCategory.Name) %></a>,&nbsp;
       <a href="<%=path3 %>"><%=Html.Encode(Model.Product.ProductCategory.Name) + " tại " + Html.Encode(Model.Product.City.Name)%></a>,&nbsp;
       <a href="<%=path4 %>"><%=Html.Encode(Model.Product.ProductCategory.Name) + " tại " + Html.Encode(Model.Product.District.Name)%></a>
        <%if (Model.Product.Project != null)
          {
              var path5 = string.Format("/product/index/{0}/{1}/{2}/{3}/0/0/{4}/0",
                        Model.Product.TypeID,
                        Model.Product.CatID,
                        Model.Product.CityID,
                        Model.Product.DistrictID,
                        Model.Product.ProjectID); %>
       ,&nbsp;<a href="<%=path5 %>"><%=Html.Encode(Model.Product.ProductCategory.Name) + " tại " + Html.Encode(Model.Product.Project.Title)%></a></li>
        <%} %>
    </h3>
    </div>
</div>
<%} %>

